package com.sunedai.tiger.dao;


import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.util.Date;

/**
 * 定义基本属性及常用方法
 * @author zhaolipeng
 */
@Getter
@Setter
@MappedSuperclass
public abstract class BaseEntity {

  @Temporal(TemporalType.TIMESTAMP)
  @Column(updatable = false)
  protected Date createDate = new Date();

  @Temporal(TemporalType.TIMESTAMP)
  @Column(nullable = false)
  @UpdateTimestamp
  protected Date updateDate = new Date();

}
